package org.smart.framework.core.bean;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;

/**
 * @author lyric
 * @version 1.0.0
 * @date 2017/2/9 10:02
 * @description 封装请求信息
 */
public class Request {

    /** 请求方法 */
    private String requestMethod;

    /** 请求路径 */
    private String requestPath;

    /**
     * @author lyric
     * @description 带参构造函数
     * @param requestMethod 请求方法
     * @param requestPath 请求路径
     */
    public Request(String requestMethod, String requestPath) {
        this.requestMethod = requestMethod;
        this.requestPath = requestPath;
    }

    /**
     * @author lyric
     * @description 获得请求方法
     * @return
     */
    public String getRequestMethod() {
        return requestMethod;
    }

    /**
     * @author lyric
     * @description 获得请求路径
     * @return
     */
    public String getRequestPath() {
        return requestPath;
    }

    @Override
    public int hashCode() {
        return HashCodeBuilder.reflectionHashCode(this);
    }

    @Override
    public boolean equals(Object obj) {
        return EqualsBuilder.reflectionEquals(this, obj);
    }
}
